package com.gqz.equip.app.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * 库存任务操作pt实体
 *
 * @author gqz20
 * @date 2023/02/25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_EN_STOCK_TASK_OPERATE")
public class EnStockTaskOperatePtEntity implements Serializable {

    /**
     * 主键
     */
    @TableId
    private String id;

    /**
     * 任务编号
     */
    @TableField(value = "TASK_NO")
    private String taskNo;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "createTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 操作时间
     */
    @TableField(value = "OPT_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "optTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date optTime;

    /**
     * 操作人
     */
    @TableField(value = "OPT_PERSON_ID")
    private String optPersonId;

    /**
     * 操作人
     */
    @TableField(value = "OPT_PERSON_NAME")
    private String optPersonName;

    /**
     * 操作状态
     */
    @TableField(value = "OPT_STATUS")
    private String optStatus;

    /**
     * 操作状态
     */
    @TableField(value = "OPT_STATUS_NAME")
    private String optStatusName;

    /**
     * start����Ǳ���Ҫ�Ķ�̬��������start   start
     */
    private static Map<String, SFunction<EnStockTaskOperatePtEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("id", EnStockTaskOperatePtEntity::getId);
        map.put("taskNo", EnStockTaskOperatePtEntity::getTaskNo);
        map.put("createTime", EnStockTaskOperatePtEntity::getCreateTime);
        map.put("optTime", EnStockTaskOperatePtEntity::getOptTime);
        map.put("optPersonId", EnStockTaskOperatePtEntity::getOptPersonId);
        map.put("optPersonName", EnStockTaskOperatePtEntity::getOptPersonName);
        map.put("optStatus", EnStockTaskOperatePtEntity::getOptStatus);
        map.put("optStatusName", EnStockTaskOperatePtEntity::getOptStatusName);

    }

    public static SFunction<EnStockTaskOperatePtEntity, ?> genColumnSFunction(String column) {
        return map.get(column);
    }
    /** end����Ǳ���Ҫ�Ķ�̬��������end   end */


}
